package com.mcp_life.module.systemmodules.service.Impl;

import com.mcp_life.entity.vo.SupermarketStoreVO;
import com.mcp_life.module.systemmodules.mapper.SystemMapper;
import com.mcp_life.module.systemmodules.service.SystemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
@Slf4j
public class SystemServiceImpl implements SystemService {
    @Autowired
    private SystemMapper systemMapper;
    @Override
    public Object showAll(Integer type) {
        List<Object>list=new ArrayList<>();
        //通过动态sql，经过标志位type的判断，来获取所需要的类型
        list=systemMapper.showAll(type);
        log.info("展示所有店铺");
        for (Object o : list) {
            if (o instanceof SupermarketStoreVO) {
                SupermarketStoreVO supermarketStoreVO = (SupermarketStoreVO) o;
                log.info("SupermarketStoreVO:{}",supermarketStoreVO);
            }
        }
        return list;
    }
    /**
     * 根据type查询商家，type标志（0全部，1家政，2餐厅，3超市）
     * @param type
     * @return
     */

}
